package cn.sz.dzy.cloud.service.impl;

import cn.sz.dzy.cloud.entities.Pay;
import cn.sz.dzy.cloud.mapper.PayMapper;
import cn.sz.dzy.cloud.service.IPayService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @program: SpringCloud2024
 * @description:
 * @author: DingZhenYun
 * @create: 2024-04-14 22:38
 **/
@Service
public class PayServiceImpl implements IPayService {
    @Resource
    private PayMapper payMapper;
    @Override
    public int add(Pay pay) {
        return payMapper.insertSelective(pay);
    }

    @Override
    public int delete(Integer id) {
        return payMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int update(Pay pay) {
        return payMapper.updateByPrimaryKeySelective(pay);
    }

    @Override
    public Pay getById(Integer id) {
        return payMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<Pay> getAll() {
        return payMapper.selectAll();
    }
}
